%include "conf.inc"

	bits 16
	org LOADER_SEG - 2
	;; 起始两个字节表示整个段的长度
begin	dw	(end - begin)
msg	db	'aaaaaa', 13, 10, 0
start:
	pusha
	mov	si, LoaderMessage
	call 	print_message
	popa
	ret

;------------------------------------------------------
; clear_screen()
; description:
;		clear the screen & set cursor position at (0,0)
;------------------------------------------------------
clear_screen:
	pusha
	mov ax, 0x0600
	xor cx, cx
	xor bh, 0x0f	; white
	mov dh,	24
	mov dl, 79
	int 0x10
	
set_cursor_position:
	mov ah, 02
	mov bh, 0
	mov dx, 0
	int 0x10	
	popa
	ret

;--------------------------------
; print_message()
; input: 
;		si: message
;--------------------------------
print_message:
	pusha
	mov ah, 0x0e
	xor bh, bh	

do_print_message_loop:	
	lodsb
	test al,al
	jz do_print_message_done
	int 0x10
	jmp do_print_message_loop

do_print_message_done:	
	popa
	ret


LoaderMessage:	db "boot...", 13, 10, 0
end: